import { omitObject } from '../../utils/utils';
import { ReactComponent as IFirm } from './firm.svg';
import { ReactComponent as IIconAdd } from './icon_add.svg';
import { ReactComponent as IIconClear } from './icon_clear.svg';
import { ReactComponent as IIconDelete } from './icon_delete.svg';
import { ReactComponent as IIconExit } from './icon_exit.svg';
import { ReactComponent as IIconExport } from './icon_export.svg';
import { ReactComponent as IIconHome } from './icon_home.svg';
import { ReactComponent as IIconLock } from './icon_lock.svg';
import { ReactComponent as IIconLogs } from './icon_logs.svg';
import { ReactComponent as IIconMonitor } from './icon_monitor.svg';
import { ReactComponent as IIconNotification } from './icon_notification.svg';
import { ReactComponent as IIconOrder } from './icon_order.svg';
import { ReactComponent as IIconProduct } from './icon_product.svg';
import { ReactComponent as IIconRefresh } from './icon_refresh.svg';
import { ReactComponent as IIconSetting } from './icon_setting.svg';
import { ReactComponent as IIconSystem } from './icon_system.svg';
import { ReactComponent as IIconUnlock } from './icon_unlock.svg';
import { ReactComponent as IIconUser } from './icon_user.svg';
 
export const Firm =(props: any) => <IFirm  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconAdd =(props: any) => <IIconAdd  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconClear =(props: any) => <IIconClear  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconDelete =(props: any) => <IIconDelete  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconExit =(props: any) => <IIconExit  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconExport =(props: any) => <IIconExport  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconHome =(props: any) => <IIconHome  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconLock =(props: any) => <IIconLock  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconLogs =(props: any) => <IIconLogs  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconMonitor =(props: any) => <IIconMonitor  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconNotification =(props: any) => <IIconNotification  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconOrder =(props: any) => <IIconOrder  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconProduct =(props: any) => <IIconProduct  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconRefresh =(props: any) => <IIconRefresh  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconSetting =(props: any) => <IIconSetting  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconSystem =(props: any) => <IIconSystem  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconUnlock =(props: any) => <IIconUnlock  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
export const IconUser =(props: any) => <IIconUser  className={`svg-icon ${props?.className}`} {...omitObject(props, ['className'])}  />
 
export type IconNameType = 'Firm' | 'IconAdd' | 'IconClear' | 'IconDelete' | 'IconExit' | 'IconExport' | 'IconHome' | 'IconLock' | 'IconLogs' | 'IconMonitor' | 'IconNotification' | 'IconOrder' | 'IconProduct' | 'IconRefresh' | 'IconSetting' | 'IconSystem' | 'IconUnlock' | 'IconUser'

export const iconMap: {
  [x: string]: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
} = {
Firm: IFirm,
IconAdd: IIconAdd,
IconClear: IIconClear,
IconDelete: IIconDelete,
IconExit: IIconExit,
IconExport: IIconExport,
IconHome: IIconHome,
IconLock: IIconLock,
IconLogs: IIconLogs,
IconMonitor: IIconMonitor,
IconNotification: IIconNotification,
IconOrder: IIconOrder,
IconProduct: IIconProduct,
IconRefresh: IIconRefresh,
IconSetting: IIconSetting,
IconSystem: IIconSystem,
IconUnlock: IIconUnlock,
IconUser: IIconUser,
};

// end

interface Props {
  type: IconNameType;
  className?: string;
  onClick?: () => void;
}

export function SVGIcon({ type, className, onClick }: Props) {
  let IconClass = iconMap[type];
  if (!IconClass) {
    return null;
  }
  return <IconClass className={`svg-icon ${className}`} onClick={() => onClick && onClick()} />;
}